package com.co.server.dao.vote.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;
import org.springframework.util.Assert;

import com.co.common.dao.BaseDaoImpl;
import com.co.common.exception.DaoException;
import com.co.server.dao.vote.TVoteUserDao;
import com.co.server.entity.vote.TVoteUser;

@Repository
public class TVoteUserDaoImpl extends BaseDaoImpl<TVoteUser, Integer> implements TVoteUserDao {

	private static final String SELECT_ITEM_COUNT="selectItemCount";
	
	
	public List<Map<String,Object>> selectItemCount(Integer voteId) {
		Assert.notNull(voteId);
		Map<String,Integer> map = new HashMap<String,Integer>();
		map.put("voteId", voteId);
		try {
			return this.sqlSession.selectList(SELECT_ITEM_COUNT, map);
		} catch (Exception e) {
			throw new DaoException(String.format("根据ID查询对象出错！语句：%s", getSqlName(SELECT_ITEM_COUNT)), e);
		}
	}
}